#!/usr/bin/python
# -*- coding: utf-8 -*-

from Tkinter import *

from pdf_img import img_tool

def create():
	inf  = '/home/frank/data/50way-015.pgm'
	outf = '/tmp/result.pgm'
	img_tool.splitImage(inf, outf, 640, 960)
	image = PhotoImage(file= outf)
	label.configure(image = image)
	label.image = image

if __name__ == '__main__':
	root = Tk()

	image_data = PhotoImage()
	label = Label(root, width=640,image=image_data, height = 960)

	button = Button(root, text = 'create', command=create)
	button.pack()
	label.pack()	
	
	root.mainloop()

